﻿<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="PurchaseSales.Manage" namespace="PurchaseSales.Manage.Model.Entities">
  <class name="Supplier" table="Supplier" lazy="true">
    <id name="Id" column="Id" type="Guid">
      <generator class="guid.comb" />
    </id>
    <property type="string" name="Number" column="[Number]" not-null="1" unique="1"/>
    <property type="string" name="Name" column="[Name]" />
    <property type="string" name="Tel" column="[Tel]" />
    <property type="string" name="Phone" column="[phone]" />
    <property type="string" name="Address" column="[Address]" />
    <property type="string" name="PostCode" column="[PostCode]" />
    <property type="string" name="ContactPerson" column="[ContactPerson]" />

    <bag name="PurchaseCommodities" cascade="all">
      <key column="Supplier"/>
      <one-to-many  class="PurchaseCommodity"/>
    </bag>
  </class>
</hibernate-mapping>